#ifndef MYBUTTON_H
#define MYBUTTON_H

#include <QWidget>
#include<QPushButton>
#include <QDebug>
class MyButton : public QPushButton
{
    Q_OBJECT
public:
    explicit MyButton(QWidget *parent = nullptr);
    void set(QString normal,QString enter,QString chicked);
    inline void setfalg(bool falg){
        m_falg=falg;
    }
    inline void mypress(){
        if(this->m_falg){
           this->setStyleSheet(this->m_chicked);
        }
        else{
           this->setStyleSheet(this->m_normal);
        }
    }
protected:
    void enterEvent(QEvent*ev);
    void leaveEvent(QEvent *ev);
signals:
private:
    QString m_normal;
    QString m_enter;
    QString m_chicked;
    bool m_falg;              //判断当前按钮是都被按下
};

#endif // MYBUTTON_H
